import { getCategoryFilterAPI } from '@/apis/category'
import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
export function useFilterData() {
    // 获取面包屑导航数据
    const filterData = ref({})
    //route不应该在函数外面
    const route = useRoute()
    const getFilterData = async () => {
        const res = await getCategoryFilterAPI(route.params.id)
        filterData.value = res.data.result
    }
    onMounted(() => {
        getFilterData()
    })
    return {
        filterData
    }
}